#include <iostream>
#include <cstdio>
#include <cstring>

#define N 1001

using namespace std;

int a[N][N];    int vis[N][N];      int ans[N];

int main(){
    memset(vis, 0, sizeof(vis));
    memset(ans, 0, sizeof(ans));
    int n, m, k;
    cin >> n >> m >> k;
    for(int i = 1; i <=n; i++){
        for(int j = 1; j <= m; j++){
            scanf("%d", &a[i][j]);
        }
    }
    for(int i = 1; i <=n; i++){
        for(int j = 1; j <= m; j++){
            if(vis[j][a[i][j]] == 0){
                vis[j][a[i][j]] = 1;
                ans[a[i][j]]++;
            }
        }
    }
    for(int i = 1; i <= k; i++){
        printf("%d ", ans[i]);
    }
    return 0;
}